package com.ffms.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ffms.entity.FamilyMember;
import com.ffms.service.AdminService;

import com.ffms.service.impl.AdminServiceImpl;
@WebServlet("/ShowAllFMServlet")
public class ShowAllFMServlet extends HttpServlet {

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		this.doPost(request, response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		//1.获取用户请求数据
		//2.调用业务层调取成员信息
		AdminService adminService = new AdminServiceImpl();
		List <FamilyMember> familyMemberList = adminService.findAllMember();
		//3.跳转到显示成员页面
		request.setAttribute("familyMemberList", familyMemberList);
		request.getRequestDispatcher("/admin/familyMemberList.jsp").forward(request, response);
	}

}
